#include "trap.h"
#include "../include/shift_test.h"
   .set noat
   .globl main
   .set noreorder
   .text
main:

   TEST_SLLV(0x00000001, 0x00000001, 0x00000002)
   TEST_SLLV(0x00000001, 0xFFFFFF01, 0x00000002) # 保留低 5 位

   TEST_SLL(0x00000001, 0x01, 0x00000002)
   TEST_SLL(0x00000001, 0x01, 0x00000002)

   TEST_SRAV(0xFFFFFFFF, 0x00000001, 0xFFFFFFFF) # 算术右移
   TEST_SRAV(0x00000010, 0xFFFFFF01, 0x00000008) # 保留低 5 位

   TEST_SRA(0xFFFFFFFF, 0x01, 0xFFFFFFFF)
   TEST_SRA(0x00000010, 0x01, 0x00000008)

   TEST_SRLV(0xFFFFFFFF, 0x00000001, 0x7FFFFFFF) # 逻辑右移
   TEST_SRLV(0x00000010, 0xFFFFFF01, 0x00000008) # 保留低 5 位

   TEST_SRL(0xFFFFFFFF, 0x01, 0x7FFFFFFF)
   TEST_SRL(0x00000010, 0x01, 0x00000008)

   HIT_GOOD_TRAP

inst_error:
   HIT_BAD_TRAP